<template>
    <div class="AnesthesiaRecord">
        <div class="Diagnose nBox">
            <div class="h0">
                <p class="lt">麻醉记录</p>
            </div>
            <div class="czq panel-default">
                <div class="pucType2">
                    <p>
                        <span>请选择日期：</span>
                        <input type="text" class="form-control"/> -
                        <input type="text" class="form-control"/>
                    </p>
                    <p>
                        <button class="btn btn-primary">确定</button>
                    </p>
                </div>
                <div class="Tb">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>医疗机构</th>
                            <th>就诊类别</th>
                            <th>手术开</th>
                            <th>手术结</th>
                            <th>麻醉开</th>
                            <th>麻醉方式</th>
                            <th>麻醉体</th>
                            <th>麻醉药</th>
                            <th>麻醉效果</th>
                            <th>主刀医生</th>
                            <th>麻醉医生</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>-</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</template>
<script>
    export default {
        name: "Modularinformation",
        data() {
            return {
                msg: "SystemManagement 下的 Modularinformation",

            };
        },
        methods: {
            openDetails(row, index) {
                this.model_id = row.id;
                this.model_name = row.name;
                this.changeSelectStyle = index;
                if (this.model_XZBJ == "1") {
                    this.model_jm = row.id;
                    this.queryz();
                    this.changeSelectStyle = "0";
                    this.model_jm = "";
                }

                console.log(row);
            },
            handleChange(val) {
                console.log(val);
            },
            //主表保存
            savez() {
                if (this.model_name == "") {
                    this.$message({showClose: true, message: "模块名称不能为空！", type: "error"});
                    return;
                }
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11041",
                    input: {
                        "id": this.model_id == "" ? "1" : this.model_id,
                        "name": this.model_name
                    }
                };
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (res.code == 0) {
                            this.model_XZBJ = "1"
                            this.$message({message: res.msg, type: "success"});
                            this.queryz();
                            this.addMasterUser();
                            document.getElementById("2").focus();
                        } else {
                            this.$message({showClose: true, message: res.msg, type: "error"});
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //删除主表信息
            deletez() {
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11043",
                    input: {
                        "id": this.model_id
                    }
                };
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (res.code == 0) {
                            this.$message({message: res.msg, type: "success"});
                            this.queryz();
                            this.addMasterUser();
                        } else {
                            this.$message({showClose: true, message: res.msg, type: "error"});
                        }
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            //主表查询

            queryz() {
                this.model_query = [];
                var data = {
                    model: "11.综合维护-模块信息",
                    code: "11042",
                    input: {
                        jm: this.model_jm ? this.model_jm : ""
                    }
                };
                console.log(data)
                this.$post("CloudHIS/Business_Handle", data)
                    .then(res => {
                        if (this.model_XZBJ == "1") {
                            this.model_query.push( res.data[res.data.length - 1]);this.model_XZBJ = "";
                            this.changeSelectStyle = "0";
                        } else {
                            this.model_query = res.data;
                            this.addMasterUser();
                        }
                        console.log("查询结果");
                        console.log(res);
                    })
                    .catch(err => {
                        console.log(err);
                    });
            },
            submit1() {
                var ele = window.event.srcElement;
                var idcount = parseInt(ele.id) + 1;

                document.getElementById(idcount + "").focus();
            },

        },
        mounted(){

        },
        created() {
            this.msg = this.$route.query;
            console.log("接收过来的传参#############################################################################")
            console.log(this.msg)
            if (this.msg.Token != null && this.msg.Token != "") {
                console.log("设置Token")
                this.$setToken(this.msg.Token)
                this.$setItemUrl(this.msg.ItemIP)
                var loginInfor = this.msg.loginInfor;
                this.LoginInfor = JSON.parse(loginInfor);
                console.log("个人登录信息");
                console.log(this.LoginInfor);
                if (this.LoginInfor != null) {
                    this.huizhenObj.Consult.HospitalId = this.LoginInfor.HospitalId
                    this.huizhenObj.Consult.DeptId = this.LoginInfor.UserId
                    this.huizhenObj.Consult.DoctorId = this.LoginInfor.UserId
                }
            } else {
                console.log("Token为空")
                var loginInfor = localStorage.getItem('LoginInfor');
                this.LoginInfor = JSON.parse(loginInfor);
                console.log("个人登录信息");
                console.log(this.LoginInfor);
                if (this.LoginInfor == null) {
                    this.LoginInfor = {
                        SectionName: "",
                        UserName: ""
                    }
                }
            }

        }
    };
</script>

<style lang="scss">
    .AnesthesiaRecord{
        .Diagnose .pucType2{ padding-top: 4px;}
        .Diagnose .Tb{margin: 0 15px; position: absolute; top:95px; bottom: 0;left: 0; right: 0}
        .Diagnose .Tb table td a{ display: block;}
        .Diagnose .Tb table td b{ font-size: 18px; color: #0092ff;}
        .Diagnose .Tb table td i{color: #0092ff; margin-right: 5px; cursor: pointer;}
        /*选择平台页*/
        .IfChange{
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            border: none;
            padding-left: 200px;
        }
        /*公共管理头部*/
        .nBox .h0{
            height: 45px;
            padding:6px 0 0 9px;
            border-bottom:1px solid #d2ecff;
        }
        .nBox .h0 .lt{
            font-size: 18px;
            line-height: 32px;
            padding-left: 5px;
            color: #6bb1ec;
            font-weight: bold;
        }
        .nBox .h0 .rt{margin-right: 12px;}
        .nBox .h0 .rt .btn{margin-left: 5px;}
        .nBox .Ahead{ height: 32px;line-height: 32px;padding: 0 15px;
            background:#ecf4ff;     color: #0092ff;}
        .nBox .Ahead .btn{ padding: 2px 12px; margin-top: -4px;}
        .nBox .Ahead i{ color: #0092ff;cursor: pointer}
        .nBox .Tb label{margin: 0;display: block; cursor: pointer}
        .nBox .Tb label b{ margin-right: 5px; float: left}

        .nBox .menu{ padding: 0 10px 0 15px;}
        .nBox .menu dl{ margin-bottom: 2px; position: relative;}
        .nBox .menu dl:before{ content: ''; border-left: 1px dashed #a4d5ff; height: calc(90%);
            position: absolute; left: 6px; top: 24px; }
        .nBox .menu dl:last-child:before{ display: none; }
        .nBox .menu dt{ line-height:30px; font-weight: normal; color: #177ad0; }
        .nBox .menu label{margin: 0;}
        .nBox .menu label input{position: relative; top: 1px;margin-right: 5px;}
        .nBox .menu dt label{position: relative;margin-left: 2px;}
        .nBox .menu dt label:before{content: ''; width: 7px; height: 0; border-bottom: 1px dashed #ddd;
            position: absolute; left:-8px; top: 14px; }
        .nBox .menu dd{ margin-left: 28px; line-height: 24px; position: relative; cursor: pointer;
            padding-left: 16px;}
        .nBox .menu dd dd:hover,
        .nBox .menu dd.high{background: #ecf4ff; }
        .nBox .menu dd:before{ content: ''; border-left: 1px dashed #ddd; height: calc(100%);
            position: absolute; left: 0; top: 0;  }
        .nBox .menu dd:after{ content: ''; width: 13px; height: 0; border-bottom: 1px dashed #ddd;
            position: absolute; right: calc(100% - 15px); top: 11px; }
        .nBox .menu dd:last-child:before{ height: 11px;}
        .nBox .menu dd i{ color: #999; margin-right:6px;display: inline-block; width: 11px;}
        .nBox .menu dd label{ display: block;cursor: pointer}
        .nBox .menu dd b{ margin-left: -22px; position: relative; z-index: 2; top: -4px;}
        .nBox .menu dd dd{margin-left: 6px;}
        .nBox .menu b{ width: 12px; display: inline-block; line-height: 12px; padding-top: 0;
            height: 13px; font-weight: normal; float: left; background-color: #73b1e7;
            margin-top: 8px; margin-right: 8px; font-size: 14px; border-radius: 2px;
            text-align: center; color: #ffffff; outline: none; border: 0; cursor: pointer; }
        /*背景弹框*/
        .blackBg{
            position: fixed;
            z-index: 999;
            background: rgba(0,0,0,0.5);
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        .blackBg .closes{
            color: #666;
            font-size: 30px;
            position: absolute;
            right: 5px;
            top: 0;
            padding: 0 5px;
            cursor: pointer;
        }
        .blackBg .p500{
            width: 550px;
        }
        .blackBg .p1000{
            width: 1000px;
        }
        .pucType2 p{
            float: left;
            margin-left: 15px;
            margin-top: 5px;
        }
        .pucType3 p{
            float: left;
            margin-left: 10px;
            margin-top: 5px;
        }
        .pucType2 p span{
            background: #f6f6f6;
            height: 32px;
            float: left;
            border: 1px solid #ccc;
            margin-right: -2px;
            position: relative;
            padding-left: 5px;
            line-height: 31px;
            z-index: 2;
            border-top-left-radius: 3px;
            border-bottom-left-radius: 3px;
        }
        .pucType3 p span{
            background: #f6f6f6;
            height: 28px;
            float: left;
            border: 1px solid #ccc;
            margin-right: -2px;
            position: relative;
            padding-left: 5px;
            line-height: 27px;
            z-index: 2;
            border-top-left-radius: 3px;
            border-bottom-left-radius: 3px;
        }
        .pucType2 .form-control{
            width: 150px;
            padding: 0 5px;
        }
        .pucType3 .form-control{
            height: 28px;padding: 0 5px;
        }
        .pucType5 p{ float: left; margin-left: 10px; margin-top: 5px;}
        .pucType5 p label{ background: #f6f6f6; height: 28px; float: left; border: 1px solid #ccc;
            margin:0 -2px 0 0; position: relative; padding-left: 5px; line-height: 27px;
            z-index: 2; border-top-left-radius: 3px; border-bottom-left-radius: 3px;}
        .pucType5 .form-control{
            height: 28px;padding: 0 5px;width: 132px;
        }
        .Tb{border: 1px solid #ccc;}
        .Tb table{border: none; margin: 0;}
        .Tb table th:first-child,.Tb table td:first-child{ border-left: none;}
        .Tb table th:last-child,.Tb table td:last-child{ border-right: none;}
    }

</style>
